package com.why.dao;

import com.why.pojo.ProductCategory;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ProductCategoryMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ProductCategory record);

    int insertSelective(ProductCategory record);

    ProductCategory selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ProductCategory record);

    int updateByPrimaryKey(ProductCategory record);

    //根据父级id查询子分类
    List<ProductCategory>proCategoryList(int parentId);

    //根据所有分类级别查找
    List<ProductCategory>proCategoryListByType(int typeId);

    //所有分类级别
    List<ProductCategory>allCategoryList(Integer pageNum,Integer pageSize);

    //根据父id查询子分类个数
    int selectCount(Integer parentId);

    //根据名称查询分类是否已存在
    int categoryExist(ProductCategory productCategory);
}